/*
    Copyright (C) 2010-2011 mdis
    
    This file is part of mdis.
    Written by Ketfi-Chérif Mehdi <ketficherif.mehdi@gmail.com>

    mdis is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    mdis is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with mdis.  If not, see <http://www.gnu.org/licenses/>.

*/


#ifndef _STRUCT_H
#define _STRUCT_H

typedef struct _plugin
{
	void * handle;
	char *directory;
	uint32_t directory_size;
	char *libname;
	uint32_t libname_size;
	plugin_sym_t * funcs;
	plugin_desc_t *pdesc;
}plugin_t;

typedef struct infile
{
	char * fname;
	FILE * file;
	long fsize;
	//char * filebuf;
	uint8_t * binbuf;
	uint16_t nbytes_tot;
	uint16_t start_addr;
}infile_t;

typedef struct _tui_colors {
	short pair;
	short fore;
	short bkgd;
}tui_colors_t;

typedef struct _static_text
{
	WINDOW *win;
	uint16_t w , h , x , y;
	char *text;
}static_text_t , * pstatic_text_t;

typedef struct _mwindow
{
	WINDOW *win;
	uint16_t w, h, x, y;
	char *title;
}mwindow_t , *pmwindow_t;

typedef struct _tui_listview
{
	WINDOW *win;
	WINDOW **witems;
	char **items;
	int **attr;
	uint16_t w, h, x, y;
	uint16_t nitems , citem , maxitems , fitem;
	uint8_t focus;
}tui_listview_t,*ptui_listview_t;

typedef struct _tui_hexview
{
	WINDOW *win;
	uint8_t * data;
	uint16_t nbytes;
	uint16_t curs, start, end;
	uint16_t w , h , x , y;
	uint8_t focus;
}tui_hexview_t,*ptui_hexview_t;


#endif
